<?php
namespace BP\DA;
require_once("java/util/ArrayList.php");
class DataColumnCollection 
// extends ArrayList 
{
	protected static $serialVersionUID;	// long
	protected $Table;	// DataTable
	public static function __staticinit() { // static class members
		self::$serialVersionUID = 1;
	}
	public static function constructor__DataTable ($table) // [DataTable table]
	{
		$me = new self();
		$me->Table = $table;
		return $me;
	}
	public function getTable () 
	{
		return $this->Table;
	}
	public function Add_DataColumn ($column) // [DataColumn column]
	{
		$column->setTable($this->Table);
		$this->add($column);
	}
	public function Add_String ($columnName) // [String columnName]
	{
		$column = DataColumn::constructor__String($columnName);
		$column->setTable($this->Table);
		$this->add($column);
		return $column;
	}
	public function Add_String_Object ($columnName, $DataType) // [String columnName, Object DataType]
	{
		$column = DataColumn::constructor__String_Object($columnName, $DataType);
		$column->setTable($this->Table);
		$this->add($column);
		return $column;
	}
	public function Add_UL ($columnName, $DataType) // [String columnName, Object DataType]
	{
		$column = DataColumn::constructor__String_Object_String($columnName, $DataType, NULL);
		$column->setTable($this->Table);
		$this->add($column);
		return $column;
	}
	public function get ($columnName) // [String columnName]
	{
		$column = NULL;
		foreach ($this as $dataColumn) 		{
			if ($dataColumn->ColumnName->toLowerCase()->equals($columnName->toLowerCase()))
			{
				if (($dataColumn->oldColumnName == NULL))
					$dataColumn->oldColumnName = $dataColumn->ColumnName;
				return $dataColumn;
			}
		}
		return $column;
	}
	public function contains ($o) // [Object o]
	{
		for ($i = 0; ($i < $this->size()); ++$i) 
		{
			if ($o->equalsIgnoreCase($this->get($i)))
			{
				return  TRUE ;
			}
		}
		return  FALSE ;
	}
}
DataColumnCollection::__staticinit(); // initialize static vars for this class on load
?>
